package edu.gdkm.dao;

import edu.gdkm.pojo.IdCard;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface IdCardDAO {
    //查询
    @Select("select * from tb_idcard where id = #{id}")
    IdCard findById(Integer id);
    //列表查询
    @Select("Select * from tb_idcard")
    List<IdCard> findAll();
    //添加
    @Insert("insert into tb_idcard(cardNo,governmentSector,usefulYears) values(#{cardNo},#{governmentSector},#{usefulYears})")
    boolean save(IdCard idCard);
    //修改
    @Insert("update tb_idcard set cardNo = #{cardNo},governmentSector = #{governmentSector},usefulYears = #{usefulYears} where id = #{id}")
    boolean update(IdCard idCard);
    //删除
    @Insert("delete from tb_idcard where id = #{id}")
    boolean delete(Integer id);
}
